﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Main.Master" Inherits="System.Web.Mvc.ViewPage<QuanLyNhaThuoc.Models.ProductModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="box box-success">
        <div class="box-header">
            <h3 class="box-title" style="width: 100%">
                Danh mục hàng hóa</h3>
            <div class="box-tools">
                <div class="row">
                    <div class="col-md-12">
                        <div class="col-md-8 xl1">
                            <div class="btn-toolbar" style="margin-left: -9px">
                                <button class="btn btn-sm btn-default" onclick="location.href = '/Category/ProductAdd'">
                                    Nhập hàng
                                </button>
                                <button class="btn btn-sm btn-default" id="btnEditProduct">
                                    Sửa hàng
                                </button>
                                <button class="btn btn-sm btn-default">
                                    Hủy hàng
                                </button>
                            </div>
                        </div>
                        <div class="col-md-4 xl2">
                            <% using (Html.BeginForm("Search", "Category", FormMethod.Post)) %>
                            <% { %>
                            <div class="input-group">
                                <div class="input-group-btn remove-width">
                                    <%= Html.DropDownListFor(m => m.value,Model.lstProductSearch, new { @class = "select-default f" })%>
                                </div>
                                <%= Html.TextBoxFor(m=>m.searchText, new { @class = "form-control", @name = "table_search", @placeholder = "Tìm kiếm..." })%>
                                <div class="input-group-addon">
                                    <input type="submit" class="btn-f" value />
                                    <i class="fa fa-search"></i>
                                </div>
                            </div>
                            <% } %>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <form id="form">
        <div class="box-body table-responsive no-padding">
            <table id="table-import" class="table table-hover" cellpadding="0" cellspacing="0"
                border="0">
                <tbody>
                    <tr>
                        <th style="text-align: center">
                        </th>
                        <th style="text-align: center">
                            #
                        </th>
                        <th>
                            Mã hàng
                        </th>
                        <th>
                            Tên hàng
                        </th>
                        <th>
                            Ngày nhập
                        </th>
                        <th>
                            Người nhập
                        </th>
                        <th>
                            Giá mua
                        </th>
                        <th>
                            Giá bán
                        </th>
                        <th>
                            Loại hàng
                        </th>
                    </tr>
                    <% if (Model.lstProduct.Count != 0) { %>
                    <% foreach (var item in Model.lstProduct) { %>
                    <tr>
                        <td align="center">
                            <input type="checkbox" class="validate[required,maxCheckbox[1]] checkbox" name="chk">
                        </td>
                        <td align="center">
                            <%: item.ID %>
                        </td>
                        <td>
                            <%: item.ProductCode %>
                        </td>
                        <td>
                            <%: item.ProductName %>
                        </td>
                        <td>
                            <%: item.DateCreated.ToString("dd/MM/yyyy HH:mm") %>
                        </td>
                        <td>
                            <%: item.UserName %>
                        </td>
                        <td align="right">
                            <%= QuanLyNhaThuoc.HelperClass.Common.FormatMoneyDisplay(item.Buy.ToString(),"VND") %>
                            <%: item.CCYID %>
                        </td>
                        <td align="right">
                            <%= QuanLyNhaThuoc.HelperClass.Common.FormatMoneyDisplay(item.Sell.ToString(),"VND") %>
                            <%: item.CCYID %>
                        </td>
                        <td>
                            <%: item.ProductTypeName %>
                        </td>
                    </tr>
                    <% } %>
                    <% } %>
                    <% else { %>
                    <tr>
                        <td colspan="8" align="center" style="color: Red; font-weight: bold;">
                            <%: ConfigurationManager.AppSettings["NoRecord"] %>
                        </td>
                    </tr>
                    <% } %>
                </tbody>
            </table>
            <% if (Model.lstProduct.Count != 0) { %>
            <div class="col-xs-6">
                <div class="dataTables_info" id="example2_info">
                    <b>Có tất cả
                        <%: Model.paging.TotalRecordCount%>
                        sản phẩm tìm thấy</b></div>
            </div>
            <div class="col-xs-6">
                <div class="dataTables_paginate paging_bootstrap">
                    <% Html.RenderPartial("Pager", Model.paging); %>
                </div>
            </div>
            <%} %>
        </div>
        </form>
    </div>
    <script src="/Scripts/jquery-1.5.1.js" type="text/javascript"></script>
    <script src="/Scripts/Pharma/jquery.min.js" type="text/javascript"></script>
    <!-- jQuery UI 1.10.3 -->
    <script src="/Scripts/Pharma/jquery-ui-1.10.3.min.js" type="text/javascript"></script>
    <!-- Bootstrap -->
    <script src="/Scripts/Pharma/bootstrap.min.js" type="text/javascript"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="/Scripts/Pharma/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"
        type="text/javascript"></script>
    <!-- AdminLTE App -->
    <script src="/Scripts/Pharma/AdminLTE/app.js" type="text/javascript"></script>
    <script src="/Scripts/Pharma/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
    <script src="/Scripts/Pharma/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
    <link href="/Content/themes/Pharma/datatables/dataTables.bootstrap.css" rel="stylesheet"
        type="text/css" />
    <script type="text/javascript">
        $("#tvCategory").addClass("active");
        $("#ulCategory").attr("style", "display:block");
        $("#liProduct").addClass("active");
        
    </script>
    <!-- Validation engine -->
    <link href="/Content/themes/ValidationEngine/validationEngine.jquery.css" rel="stylesheet"
        type="text/css" />
    <script src="/Scripts/Pharma/plugins/ValidationEngine/jquery.validationEngine.js"
        type="text/javascript"></script>
    <script src="/Scripts/Pharma/plugins/ValidationEngine/jquery.validationEngine-vi.js"
        type="text/javascript"></script>
    <script src="/Scripts/Pharma/Pharmacy.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#btnEditProduct").click(function (e) {
                e.preventDefault();
                Pharma._init();
                if (Pharma._bound_noparam() != false) {
                    window.location.href = "/Transaction/Modify/" + $("#list input:checkbox:checked").val();
                }
            });
        });        
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <%:ViewBag.Title %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="NavBar" runat="server">
    <h1>
        Danh mục hàng hóa <small>Control panel</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i>Home</a></li>
        <li class="active">Danh mục</li>
        <li class="active">Danh mục hàng hóa</li>
    </ol>
</asp:Content>
